import {
  getRequestInfo,
  postRequestList,
  postRequestData,
  postRequest,
  getRequest,
  delRequestPost,
  importFile,
  postRequestJson,
} from '../utils/request'
// 商品企划表
export const getProductPlanning = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/productPlanning/pageList`, data)

export const getProductPlanningById = <T>(data?: any): Promise<IResponsePost<T>> =>
  getRequestInfo(`/api/sop/sop/productPlanning/getInfoById`, data)

export const getProductPlanningByPlanNo = <T>(data?: any): Promise<IResponsePost<T>> =>
  getRequestInfo(`/api/sop/sop/productPlanning/getInfoByPlanNo`, data)

export const createProductPlanning = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productPlanning/create`, data)

export const updateProductPlanning = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productPlanning/update`, data)

export const importExceProductPlanning = <T>(data?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/productPlanning/importExcel`, data)

export const exportExcelProductPlanning = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productPlanning/exportExcel`, data)
export const reserveInvoiceExport = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/reserveInvoice/export`, data)
export const productSpuDevelopmentExportExcel = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productSpuDevelopment/exportExcel`, data)
export const associatePlaning = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productSpuDevelopment/associatePlaning`, data)

export const deleteProductPlanning = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/productPlanning/delete`, data)

export const updatePlanStatus = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/productPlanning/planStatus`, data)

export const productSpuDevelopmentimportExcel = <T>(data?: any): Promise<IResponseData<T>> =>
  importFile(`/api/sop/sop/productSpuDevelopment/importExcelForCreate`, data)
export const productSpuDevelopmentUpdateExcel = <T>(data?: any): Promise<IResponseData<T>> =>
  importFile(`/api/sop/sop/productSpuDevelopment/importExcelForUpdate`, data)
export const importExcelForCreateForScene = <T>(data?: any): Promise<IResponseData<T>> =>
  importFile(`/api/sop/sop/productSpuDevelopment/importExcelForCreateForScene`, data)
export const productSpuDevelopmentUpdateStatusExcel = <T>(data?: any): Promise<IResponseData<T>> =>
  importFile(`/api/sop/sop/productSpuDevelopment/importExcelForUpdateStatus`, data)
export const importUpdateStatusWithoutConfirm = <T>(data?: any): Promise<IResponseData<T>> =>
  importFile(`/api/sop/sop/productSpuDevelopment/importUpdateStatusWithoutConfirm`, data)
export const importProductFabricForDev = <T>(data?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/productSpuDevelopment/importProductFabricForDev`, data)

//开发季
export const getProductDevelopmentSeason = <T>(data?: any): Promise<IResponseData<T>> =>
  getRequest(`/api/sop/sop/productDevelopmentSeason/listAll`, data)

export const createDevelopmentSeason = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/productDevelopmentSeason/create`, data)

export const deleteDevelopmentSeason = <T>(data?: any): Promise<IResponseData<T>> =>
  delRequestPost(`/api/sop/sop/productDevelopmentSeason/delete`, data)

//商品品类配置表
export const getProductClassConfigByType = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/productClassConfig/getListByType`, data)
export const getProductClassConfigById = <T>(data?: any): Promise<any> =>
  getRequest(`/api/sop/sop/productClassConfig/getChildInfoById`, data)
export const getProductClassAll = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/productClassConfig/getAllClass`, data)

// 商品管理
export const getSpuOptions = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/productSpuInfo/getSpuList`, data)
export const getSpuPageList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/productSpuInfo/pageList`, data)
export const querySku = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/productSkuInfo/querySku`, data)
export const productSpuInfoBatchUpdateStatus = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productSpuInfo/batchUpdateStatus`, data)
export const getProductSpuInfoInfoById = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productSpuInfo/getInfoById`, data)
export const spuEditBaseInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productSpuInfo/editBaseInfo`, data)
export const spuEditTagInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productSpuInfo/editTagInfo`, data)
export const spuEditAssociatedFabric = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productSpuInfo/editAssociatedFabric`, data)
export const spuEditMeasureInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productSpuInfo/editMeasureInfo`, data)
export const spuEditSkuInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productSpuInfo/editSkuInfo`, data)
export const spuEditUpdateStatus = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productSkuInfo/updateStatus`, data)
export const spuEditPicture = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productSpuInfo/editPicture`, data)
export const exportExcelProductSpuInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productSpuInfo/exportExcel`, data)
export const editTagPrice = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productSpuInfo/editTagPrice`, data)
export const importExcelProductSpuInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/productSpuInfo/importExcel`, data)
export const editImportExcelProductSpuInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/productSpuInfo/editImportExcel`, data)
export const importFranchiseInfoProductSpuInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/productSpuInfo/importFranchiseInfo`, data)
export const importWeightInfoProductSpuInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/productSpuInfo/importWeight`, data)
export const importProductFabricForSpu = <T>(data?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/productSpuInfo/importProductFabricForSpu`, data)
export const productSpuInfoPush = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productSpuInfo/push`, data)

// 款式开发
export const getProductSpuDevPageList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/productSpuDevelopment/pageList`, data)
export const productSpuDevelopmentCreate = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productSpuDevelopment/create`, data)
export const getStyleInfoById = <T>(data?: any): Promise<IResponseDetail<T>> =>
  getRequestInfo(`/api/sop/sop/productSpuDevelopment/getDetailById`, data)
export const getStyleInfoByDesignCode = <T>(data?: any): Promise<IResponseDetail<T>> =>
  getRequestInfo(`/api/sop/sop/productSpuDevelopment/getDetailByDesignCode`, data)
export const productSpuDevelopmentBatchStatus = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productSpuDevelopment/batchUpdateEnableStatus`, data)
export const productSpuDevUpdateSpuStatus = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productSpuDevelopment/updateSpuStatus`, data)
export const getSpuDevPrintListBySpuDevIds = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/productSpuDevelopment/getSpuDevPrintListBySpuDevIds`, data)
export const getSimpleListBySearchName = <T>(data?: any): Promise<IResponseData<T>> =>
  getRequest(`/api/sop/sop/productSpuDevelopment/getSimpleListBySearchName`, data)
export const getSpuDevDetailListByPlaningId = <T>(data?: any): Promise<IResponseData<T>> =>
  getRequest(`/api/sop/sop/productSpuDevelopment/getSpuDevDetailListByPlaningId`, data)

// 尺码范围
export const getProductPresetConfig = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/productPresetConfig/getList`, data)
export const getProductPresetConfigPageList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/productPresetConfig/pageList`, data)
export const getProductTemplateList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/productTemplate/queryByPage`, data)
export const getSizeListByClassId = <T>(data?: any): Promise<IResponseData<T>> =>
  getRequestInfo(`/api/sop/sop/productPresetConfig/getSizeListByClassId`, data)

//商品面料
export const getProductFabricPageList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/productFabricConfig/pageList`, data)
export const productFabricConfigExportExcel = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productFabricConfig/exportExcel`, data)
export const productFabricConfigimportExcel = <T>(data?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/productFabricConfig/importExcel`, data)
export const productFabricConfigUpdateStatus = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productFabricConfig/updateStatus`, data)
export const productFabricConfigEdit = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/productFabricConfig/edit`, data)

//颜色明细
export const getProductColorPageList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/productColorDetail/pageList`, data)
export const getAllProductColorGroup = <T>(data?: any): Promise<IResponseData<T>> =>
  getRequest(`/api/sop/sop/productColorGroup/getAll`, data)
export const editProductColorDetail = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productColorDetail/editProductColorDetail`, data)
export const productTemplateSave = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productTemplate/save`, data)

//商品预设属性
export const productSpuInfoeditImportExcel = <T>(data?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/productPresetConfig/importExcel`, data)

export const importProductTemplateExcel = <T>(data?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/productPresetConfig/importProductTemplateExcel`, data)

export const importIntentOrderExcel = <T>(data?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/intentOrder/importIntentOrder`, data)
//扩渗透计划导入
export const importExpandSkuDetail = <T>(data?: any, extraParams?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/reorder/expandSkuDetail/importExpandSkuDetail`, data, extraParams)

//款式开发编辑
export const psdEditDevInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productSpuDevelopment/editDevInfo`, data)
export const productSpuDevelopmenteditPlanInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productSpuDevelopment/editPlanInfo`, data)
export const psdEditMeasureInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productSpuDevelopment/editMeasureInfo`, data)
export const psdEditAssociatedFabric = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productSpuDevelopment/editAssociatedFabric`, data)
export const psdEditColorInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productSpuDevelopment/editColorInfo`, data)
export const psdEditPicture = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productSpuDevelopment/editPicture`, data)

export const getproductSizePageList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/productSizeDetail/pageList`, data)
export const getProductSizeGroupAll = <T>(data?: any): Promise<any> =>
  getRequest(`/api/sop/sop/productSizeGroup/getAll`, data)

//面种分页
export const getproductFabricTypeList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/productFabricType/page`, data)
export const addproductFabricType = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productFabricType/save`, data)
export const statusproductFabricType = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productFabricType/updateStatus`, data)

export const getPageOtbList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/purchaseOtb/pageOtb`, data)
export const purchaseOtbAuditOtb = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchaseOtb/auditOtb`, data)
export const importPurchaseOtb = <T>(data?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/purchaseOtb/importOtb`, data)

//报价单
export const quotationOrderBatchCreate = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/batchCreate`, data)
export const getQuotationOrderColorRange = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/getColorRange`, data)
export const getPageQuotationOrderList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/quotationOrder/pageQuotationOrder`, data)
export const getQuotationOrderDetail = <T>(data?: any): Promise<IResponseDetail<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/getQuotationOrderDetail`, data)
export const getHistoryVersion = <T>(data?: any): Promise<IResponseDetail<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/getHistoryVersion`, data)
export const editQuotationOrderDetail = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/editQuotationOrderDetail`, data)
export const saveMainDetail = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotation/main/detail/saveMainDetail`, data)
export const saveExcipientsDetail = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotation/excipients/saveExcipientsDetail`, data)
export const saveCraftDetail = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotation/craft/detail/saveCraftDetail`, data)
export const submitCheckPrice = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/submitCheckPrice`, data)
export const submitQuotationPrice = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/submitQuotationPrice`, data)
export const rejectToWaitQuotation = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/rejectToWaitQuotation`, data)
export const reportNegotiate = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/reportNegotiate`, data)
export const submitNegotiatePrice = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/submitNegotiatePrice`, data)
export const rejectOrConfirmQuotation = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/rejectOrConfirmQuotation`, data)
export const reNegotiate = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/reNegotiate`, data)
export const splitColor = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/splitColor`, data)
export const getQuotationOrderStatusCount = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/getQuotationOrderStatusCount`, data)
export const getIntentOrderDetail = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/quotationOrder/getIntentOrderDetail`, data)
export const queryQuotationOrderByCode = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/quotationOrder/queryQuotationOrderByCode`, data)
export const loadQuotationOrder = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/loadQuotationOrder`, data)
export const loadProduct = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/loadProduct`, data)
export const getByTinyClassId = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/productTemplate/getByTinyClassId`, data)
export const exportQuotationOrderQuotationOrder = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/exportQuotationOrder`, data)
